package com.jsy.mini12306.order.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.jsy.mini12306.common.entity.SeatType;
import com.jsy.mini12306.common.entity.TicketOrderIterm;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: SongyangJi
 * @description:
 * @since: 2021/9/9
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TicketOrderItermVO {

    @JsonSerialize(using= ToStringSerializer.class)
    private Long orderId;
    /**
     * 乘客id
     */
    private Long passengerId;
    /**
     * 票的类型
     */
    private String ticketType;
    /**
     * 票价
     */
    private Float price;
    /**
     * 座位类型
     */
    private SeatType seatType;
    /**
     * 车厢
     */
    private String bin;
    /**
     * 座位号
     */
    private String seat;


    public TicketOrderItermVO(TicketOrderIterm iterm) {
        this.orderId = iterm.getOrderId();
        this.passengerId = iterm.getPassengerId();
        this.ticketType = iterm.getTicketType();
        this.price = iterm.getPrice();
        this.seatType = iterm.getSeatType();
        this.bin = iterm.getBin();
        this.seat = iterm.getSeat();
    }
}

/*
{
  "orderId": 0,
  "passengerId": 0,
  "ticketType": "",
  "price": 0.00,
  "seatType": "BUSINESS",
  "bin": "",
  "seat": ""
}

 */